listbox: Add _append
authorTimm Bäder <mail@baedert.org>
Sat, 1 Aug 2020 13:26:28 +0000 (15:26 +0200)
committerTimm Bäder <mail@baedert.org>
Sat, 1 Aug 2020 13:26:28 +0000 (15:26 +0200)
To have easy replacement API for gtk_container_add.

docs/reference/gtk/gtk4-sections.txt
gtk/gtklistbox.c
gtk/gtklistbox.h

index 85bcb0038c4de084af839e4fada72b03a92c66fc..cb4fced509b585eaa2e1e3bfa97bc4a00d3647ff 100644 (file)
@@ -257,6 +257,7 @@ GtkListBoxUpdateHeaderFunc
 
 gtk_list_box_new
 gtk_list_box_prepend
+gtk_list_box_append
 gtk_list_box_insert
 gtk_list_box_remove
 gtk_list_box_select_row
index a95c87457a1e4db91bca2e9b9a044ebe41f186af..443ac6fa2de41e83da649efee8f777d2e76098cd 100644 (file)
@@ -2584,6 +2584,22 @@ gtk_list_box_prepend (GtkListBox *box,
   gtk_list_box_insert (box, child, 0);
 }
 
+/**
+ * gtk_list_box_append:
+ * @box: a #GtkListBox
+ * @child: the #GtkWidget to add
+ *
+ * Append a widget to the list. If a sort function is set, the widget will
+ * actually be inserted at the calculated position and this function has the
+ * same effect of gtk_container_add().
+ */
+void
+gtk_list_box_append (GtkListBox *box,
+                     GtkWidget  *child)
+{
+  gtk_list_box_insert (box, child, -1);
+}
+
 /**
  * gtk_list_box_insert:
  * @box: a #GtkListBox
index b39f55154a3d675b55e3c5b9e7f07d9bb805c8a7..301a5707a5ddab41b842343d3558882f8f4f63ad 100644 (file)
@@ -168,6 +168,9 @@ GDK_AVAILABLE_IN_ALL
 void           gtk_list_box_prepend                      (GtkListBox                    *box,
                                                           GtkWidget                     *child);
 GDK_AVAILABLE_IN_ALL
+void           gtk_list_box_append                       (GtkListBox                    *box,
+                                                          GtkWidget                     *child);
+GDK_AVAILABLE_IN_ALL
 void           gtk_list_box_insert                       (GtkListBox                    *box,
                                                           GtkWidget                     *child,
                                                           int                            position);